#pragma once 
#include <map>


#include "rtmp/rtmpapplication.h"


class AppRTMPNetConnection;

class App: public RTMPApplication {
public:
    App() = default;
    ~App() = default;

    /** RTMP application interface*/
	virtual RTMPNetConnection* Connect(const std::wstring& appName,RTMPNetConnection::Listener *listener,std::function<void(bool)> accept);

    RTMPNetConnection* GetRTMPNetConnection(std::wstring tag);

private:
    std::map<std::wstring, AppRTMPNetConnection*> _netConns;
};

class AppRTMPNetConnection : public RTMPNetConnection {
public:
	virtual RTMPNetStream* CreateStream(DWORD streamId,DWORD audioCaps,DWORD videoCaps,RTMPNetStream::Listener *listener);
	virtual void DeleteStream(RTMPNetStream *stream);
};
